<?php 
include 'inc-theme_s.php';

	//Comprobacion de carga correcta de pagina
	if ($_SERVER['HTTP_HOST'] == 'ninguno.munvi.net') { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.munvi.net/'); mysql_close($link); exit; }

	//comprobacion de uso correcto de theme.php, eso es, que se le pasa como parametro un contenido
	if (!isset($txt)) { 
		header('HTTP/1.1 404 Not Found');
		$txt = '<p style="font-size:24px;">'._("ERROR 404: Página inexistente.").'</p>';
	}

	//Comprobacion de uso autorizado
	if (isset($_GET['error'])) { 
		header('HTTP/1.1 401 Unauthorized'); 
		$txt = '<p style="font-size:24px;color:red;">ERROR: <b>'.base64_decode($_GET['error']).'</b>.</p>';
	}

	//configuracion de TITLE de pagina dinamico
	$kw = '';
	if (isset($txt_title)) { 
		$txt_title .= ' | '.PAIS.' | Munvi'; 
	} else { 	//home
		$txt_title = (isset($pol['config']['pais_des'])?$pol['config']['pais_des'].' de '.PAIS.' '.$kw.'| Munvi':PAIS.' '.$kw.'| Munvi');
	}
	if (!isset($txt_description)) { $txt_description = $txt_title.' - '.$kw.PAIS.' | Munvi'; }

	//uso de fondos
	if (isset($_GET['bg'])) { 
		$body_bg = COLOR_BG.' url(\'http://'.$_GET['bg'].'\') repeat fixed top left';
	} else if (isset($pol['config']['bg'])) { 
		$body_bg = COLOR_BG.' url(\''.IMG.'bg/'.$pol['config']['bg'].'\') repeat fixed top left'; 
	} else { $body_bg = COLOR_BG; }

	//votaciones pendientes
	votaciones_pendientes();

	//crea las opciones para acceder al perfil
	$txt_perfil = opciones_usuario($pol);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?=$txt_title?></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="language" content="es_ES" />
<meta name="description" content="<?=$txt_description?>" />

<link rel="stylesheet" type="text/css" href="<?=IMG?>style3.css" />

<?php superfish_header(); ?>

<script type="text/javascript">
var _sf_startpt=(new Date()).getTime()
defcon = <?=$pol['config']['defcon']?>;
IMG = "<?=IMG?>";
window.google_analytics_uacct = "UA-59186-46";
</script>

<style type="text/css">
body { background: <?=$body_bg?>; }
/* css cabecera nueva */
#cabecera {
	background:url(<?=IMG?>/bg75.png) repeat;
	width:auto;
	border-radius:5px;
	height:46px;
	font-family:Arial, Helvetica, sans-serif;
	min-width:940px;
}
#menu_sup {
	height:20px;
	border-bottom:#000000 solid thin;
}
#menu_logo {
	position:relative;
	top:3px;
	left:5px;
}
#menu_container {
	position:relative;
	left:200px;
	top:-14px;
}
#menu_sup_cerrar {
	float:right;
	margin-top:-10px;
	margin-right:3px;
}
#menu_sup_cerrar a {
		text-decoration:none;
}
#menu_inf {
	text-align:left;
}
#cabecera_opciones {
	text-align:right;
	float: right;
	margin-right:-55px;
}
#cabecera_opciones a {
	text-decoration:none;
}
</style>


<?=$txt_header?>
<link rel="shortcut icon" href="/favicon.ico" /> 


</head>

<body class="fullwidth">
<div id="container">


<div id="cabecera">
		<div id="menu_sup">
			<div id="menu_logo"><a href="http://www.munvi.net/" title="Munvi"><img src="<?=IMG?>logo_horizontal.png" /></a></div>
			<div id="menu_container"><?php echo $cabecera_menu; ?>
</div>
			<div id="menu_sup_cerrar"><a href="http://muvi.munvi.net/accion.php?a=logout">Salir <img src="<?=IMG?>/cerrar.png" /></a></div>
		</div>
		<div id="menu_inf">
			<?=$pol['config']['pais_des'].' de '.PAIS?>
			<div id="cabecera_opciones">
				<?php echo $txt_perfil; ?>
			</div>
		</div>
	</div>
<br />
<div class="content">
<div class="content-in">


<?=$txt.$kw?>

</div>
</div>
</div>
<div class="clear"></div>
<div id="footer">
<div id="footer-in">



<div>
<span style="float:right;font-size:14px;">
<?php
unset($txt);
echo ($pol['user_ID']==1?round((microtime(true)-TIME_START)*1000).'ms | ':'');
?>

<a href="http://www.munvi.net/legal.php" target="_blank">Condiciones de uso</abbr></a> | <a href="http://www.munvi.net/desarrollo.php">Desarrollo</a> | 
<a href="http://www.munvi.net/manual.php" target="_blank">Ayuda</a> &nbsp; 
&nbsp; 2012 <b><a href="http://www.munvi.net/" style="font-size:16px;">Munvi</a></b> <sub>Alfa</sub></span>
<?php
	echo ' <span style="font-size:11px;"><a href="http://www.virtualpol.com/" target="_blank">VirtualPOL </a></span> <span class="amarillo" id="pols_frase"><b>'.$pol['config']['pols_frase'].'</b>';
	if ($pol['config']['pols_fraseedit'] == $pol['user_ID']) { echo ' <a href="/subasta/editar/" class="gris">#</a>'; }
?>
</span>

</div>
</div>
</div>
</div>

<div id="pnick" class="azul" style="display:none;opacity:0.9;"></div>


<script type="text/javascript" src="<?=IMG?>scripts.js?v=23"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-59186-46']);
_gaq.push(['_setDomainName', '.munvi.net']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

<script type="text/javascript">
var _sf_async_config={uid:26055,domain:"munvi.net"};
(function(){
  function loadChartbeat() {
    window._sf_endpt=(new Date()).getTime();
    var e = document.createElement('script');
    e.setAttribute('language', 'javascript');
    e.setAttribute('type', 'text/javascript');
    e.setAttribute('src',
       (("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/" : "http://static.chartbeat.com/") +
       "js/chartbeat.js");
    document.body.appendChild(e);
  }
  var oldonload = window.onload;
  window.onload = (typeof window.onload != 'function') ?
     loadChartbeat : function() { oldonload(); loadChartbeat(); };
})();

</script>

</body>
</html>
<?php if ($link) { mysql_close($link); } ?>
